package com.ming.seatMonitoring.test;

import com.ming.seatMonitoring.util.DateUtil;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;

/**
 * @author 小明
 * @date 2021/10/22
 * @description
 */
public class test {

    public static void main(String[] args) {
        //最近七天的某房间的借用次数
        //前7天,前6天，前5天，前4天，前3天，前2天，昨天
        int[] last = {2,3,5,2,6,8,10};
        final Date date = new Date();
        System.out.println(DateUtil.getCurrentDate());
        System.out.println(DateUtil.getCurrentTime());

        Calendar   cal   =   Calendar.getInstance();
        cal.add(Calendar.DATE,   -1);
        String yesterday = new SimpleDateFormat( "yyyy-MM-dd ").format(cal.getTime());
        System.out.println(yesterday);

        final LocalDateTime now = LocalDateTime.now();
        final LocalDateTime localDateTime = now.minusDays(1);
        final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd ");
        final String format = dateTimeFormatter.format(localDateTime);
        System.out.println(format);

    }
}
